package com.lyl.cloud.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class TestController {

    @GetMapping("/testA")
    public String testA(){
        String str = printA();
        return str;
    }

    @SentinelResource("testA")
    private String printA() {
        String str = "hello,world A";
        log.info(str);
        return str;
    }

    @GetMapping("/testB")
    public String testB(){
        String str = "hello,world B";
        log.info(str);
        return str;
    }
}
